from rclpy.node import Node
from sum_interfaces.srv import Sum


class SumServiceServer(Node):
    def __init__(self, name: str):
        super().__init__(name)
        self.srv = self.create_service(Sum, 'add_two_ints', self.sum_callback)

    def sum_callback(self, request, response):
        response.sum = request.a + request.b
        self.get_logger().info('Incoming request\na: %d b: %d' % (request.a, request.b))
        return response
